import { defineConfig, presetWind3, presetAttributify } from 'unocss'

export default defineConfig({
  content: {
    pipeline: {
      include: [
        // the default
        /\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html)($|\?)/,
        // include js/ts files
        'src/**/*.{js,ts}',
      ],
    },
  },
  presets: [presetWind3(), presetAttributify()],
  theme: {
    colors: {
      default: '#000000e0',
      primary: '#1677ff',
      money: '#ff3e3e',
      del: '#ff3b30',
      required: '#ff4d4f',
    },
  },
  shortcuts: [['bg-sel', 'bg-#e6f4ff']],
  rules: [
    [
      /** 多行超出隐藏 */
      /^ellipsis-(\d+)$/,
      match => ({
        display: '-webkit-box',
        '-webkit-box-orient': 'vertical',
        '-webkit-line-clamp': match[1],
        overflow: 'hidden',
        'text-overflow': 'ellipsis',
      }),
    ],
  ],
})
